package com.health.trans.pojo;

import cn.hutool.extra.spring.SpringUtil;
import com.health.trans.config.dataSource.DsProperty;
import com.health.trans.config.dataSource.DynamicDsConf;
import lombok.Data;

/**
 * 读取源配置或写入源配置
 *
 * @author nqlz
 */
@Data
public class SyncProperty {
    /**
     * reader  writer 名称
     */
    private String name;
    /**
     * 读取源  写入源 源名称 dev local prod
     */
    private String source;

    /**
     * 数据库
     */
    private String dataBase;


    /**
     * 配置详细信息
     */
    private DsProperty property;

    public void setSource(String source) {
        this.source = source;
        DynamicDsConf bean = SpringUtil.getBean(DynamicDsConf.class);
        property = bean.getDsProperties().get(source);
    }
}
